//
//  GGUIFactory.m
//  MuYouDaoLi
//
//  Created by 高立发 on 2016/11/23.
//  Copyright © 2016年 Yc. All rights reserved.
//

#import "GGUIFactory.h"

@implementation GGUIFactory

//UIButton方法实现
+(UIButton *)buttonWithFrame:(CGRect)rect title:(NSString *)title imageName:(NSString *)imageName titleColor:(UIColor *)color target:(id)target action:(SEL)selector
{
    UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
    bt.frame = rect;
    [bt setTitle:title forState:UIControlStateNormal];
    [bt setTitleColor:color forState:UIControlStateNormal];
    [bt setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [bt addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
    return bt;
    
}
//UILable方法实现
+(UILabel *)lableWithFrame:(CGRect)rect backGroundColor:(UIColor *)color1 text:(NSString *)text textColor:(UIColor *)color2 font:(UIFont *)floatFont
{
    UILabel *lb = [[UILabel alloc]init];
    lb.frame = rect;
    lb.backgroundColor = color1;
    lb.text = text;
    lb.textColor = color2;
    lb.font = floatFont;
    return lb;
    
}
//UITextField方法实现
+(UITextField *)textFieldWithFrame:(CGRect)rect placeholder:(NSString *)placeholder secureTextEntry:(BOOL)bool1 textColor:(UIColor *)color1 backGroundColor:(UIColor *)color2 font:(UIFont *)font
{
    UITextField *tf = [[UITextField alloc]init];
    tf.frame = rect;
    tf.backgroundColor = color2;
    tf.placeholder = placeholder;
    tf.secureTextEntry =bool1;
    tf.textColor = color1;
    tf.font = font;
    return tf;
    
}
//UITextView
+(UITextView *)textViewWihFrame:(CGRect)rect backGroundColor:(UIColor *)color1 textColor:(UIColor *)color2 font:(UIFont *)font scrollEnabled:(BOOL)bool1 showsVerticalScrollIndicator:(BOOL)bool2
{
    UITextView *tv = [[UITextView alloc]initWithFrame:rect];
    tv.backgroundColor = color1;
    tv.textColor = color2;
    tv.font = font;
    tv.scrollEnabled = bool1;
    tv.showsVerticalScrollIndicator = bool2;
    return tv;

}

@end
